<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        #pic1 {
            position: absolute;
            top: 20px;
            left: 20px;
        }

        #pic2 {
            position: absolute;
            top: 20px;
            left: 1100px;

        }
        body{
            background-color: black;
        }
    </style>

</head>

<body>
    <img src="images/background.jpg   "  id="pic1" />
    <img src="images/1 (1).png " id="pic2" />
    <script>
        var x = 20;
        function f() {
            x += 20;
            pic1.style.left = x;
        }
        var i = 1;
        function f1() {
            i++;
            if (i == 31) {
                i = 1;
            }
            pic2.src = "images/1 (" + i + ").png";
        }

        setInterval(f, 100);
        setInterval(f1, 100);


    </script>

</body>

</html>